<div class="header" id="header">
    <div class="layui-container nav">
        <ul class="layui-nav  layui-layout-left">
            <li class="layui-nav-item logo">
                <a href="/">
                    lve123.com
                </a>
            </li>
            <li class="layui-nav-item layui-this"><a href="{:url('index/index/index')}">首页</a></li>
            {system:nav item="vv" field="title,url_link,is_reco,target" order="sort asc" }
            <li class="layui-nav-item">
                <a href="{$vv.url_link}" target="{$vv.target}">
                    {$vv.title}
                    {if $vv.is_reco == 1}
                    <span class="nav-round">推荐</span>
                    {/if}
                </a>
            </li>
            {/system:nav}
        </ul>
        <ul class="layui-nav layui-layout-right ">
            {if isset($user.id)}
            <li class="layui-nav-item layui-hide layui-show-md-inline-block">
                <a href="{:url('user/index/index')}">
                    <img src="{$user.avatar|default=''}" class="layui-nav-img">
                    {$user.nickname|default=$user.username}
                </a>
            </li>
            <li class="layui-nav-item layui-hide layui-show-md-inline-block">
                <a href="javascript:out('{:url('user/index/out')}') ;" class="out">退出</a>
            </li>
            {else /}
            <li class="layui-nav-item layui-hide layui-show-md-inline-block">
                <a href="javascript:void (0);" class="loginBtn" data-url="{:url('user/login/index')}">登陆</a>
            </li>
            <li class="layui-nav-item layui-hide layui-show-md-inline-block">
                <a href="javascript:void (0);" data-url="{:url('user/register/index')}" class="registerBtn">注册</a>
            </li>
            {/if}
        </ul>
    </div>
</div>
